<?php
namespace Common\Model;

class AdminModel extends UserModel {
    const TYPE = 5; //5表示管理员

    public function save2($d) {
        $d['type'] = self::TYPE;

        return parent::save2($d);
    }

    public function getByUid($uid) {
        $expr = array(
            'type' => self::TYPE,
            'uid'  => $uid,
        );

        return $this->where($expr)->find();
    }

    /**
     * del
     *
     * @param mixed $id
     * @return void
     */
    public function del($id) {
        $id = (int)$id;

        $expr = array(
            'type' => self::TYPE,
            'uid'  => $id,
        );

        return $this->where($expr)->delete();
    }

}
